
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
target triple = "i386-pc-linux-gnu"

define void @fractal(i32 %x, i32 %y, i32 %size) nounwind {
entry:
  %x.addr = alloca i32, align 4                   ; <i32*> [#uses=7]
  %y.addr = alloca i32, align 4                   ; <i32*> [#uses=7]
  %size.addr = alloca i32, align 4                ; <i32*> [#uses=11]
  store i32 %x, i32* %x.addr
  store i32 %y, i32* %y.addr
  store i32 %size, i32* %size.addr
  %tmp = load i32* %size.addr                     ; <i32> [#uses=1]
  %cmp = icmp sle i32 %tmp, 1                     ; <i1> [#uses=1]
  br i1 %cmp, label %if.then, label %if.end

if.then:                                          ; preds = %entry
  %tmp1 = load i32* %x.addr                       ; <i32> [#uses=1]
  %tmp2 = load i32* %x.addr                       ; <i32> [#uses=1]
  %div = sdiv i32 %tmp2, 224                      ; <i32> [#uses=1]
  %mul = mul i32 %div, 224                        ; <i32> [#uses=1]
  %sub = sub i32 %tmp1, %mul                      ; <i32> [#uses=1]
  %add = add nsw i32 %sub, 16                     ; <i32> [#uses=1]
  %tmp3 = load i32* %y.addr                       ; <i32> [#uses=1]
  %tmp4 = load i32* %y.addr                       ; <i32> [#uses=1]
  %div5 = sdiv i32 %tmp4, 224                     ; <i32> [#uses=1]
  %mul6 = mul i32 %div5, 224                      ; <i32> [#uses=1]
  %sub7 = sub i32 %tmp3, %mul6                    ; <i32> [#uses=1]
  %add8 = add nsw i32 %sub7, 16                   ; <i32> [#uses=1]
  %call = call i32 (...)* @cl_set_color(i32 235, i32 %add, i32 %add8) ; <i32> [#uses=0]
  %tmp9 = load i32* %x.addr                       ; <i32> [#uses=1]
  %tmp10 = load i32* %y.addr                      ; <i32> [#uses=1]
  %call11 = call i32 (...)* @cl_draw_point(i32 %tmp9, i32 %tmp10) ; <i32> [#uses=0]
  br label %return

if.end:                                           ; preds = %entry
  %tmp12 = load i32* %x.addr                      ; <i32> [#uses=1]
  %tmp13 = load i32* %size.addr                   ; <i32> [#uses=1]
  %div14 = sdiv i32 %tmp13, 2                     ; <i32> [#uses=1]
  %sub15 = sub i32 %tmp12, %div14                 ; <i32> [#uses=1]
  %tmp16 = load i32* %y.addr                      ; <i32> [#uses=1]
  %tmp17 = load i32* %size.addr                   ; <i32> [#uses=1]
  %div18 = sdiv i32 %tmp17, 2                     ; <i32> [#uses=1]
  %sub19 = sub i32 %tmp16, %div18                 ; <i32> [#uses=1]
  %tmp20 = load i32* %size.addr                   ; <i32> [#uses=1]
  %div21 = sdiv i32 %tmp20, 2                     ; <i32> [#uses=1]
  call void @fractal(i32 %sub15, i32 %sub19, i32 %div21)
  %tmp22 = load i32* %x.addr                      ; <i32> [#uses=1]
  %tmp23 = load i32* %size.addr                   ; <i32> [#uses=1]
  %div24 = sdiv i32 %tmp23, 2                     ; <i32> [#uses=1]
  %sub25 = sub i32 %tmp22, %div24                 ; <i32> [#uses=1]
  %tmp26 = load i32* %y.addr                      ; <i32> [#uses=1]
  %tmp27 = load i32* %size.addr                   ; <i32> [#uses=1]
  %div28 = sdiv i32 %tmp27, 2                     ; <i32> [#uses=1]
  %add29 = add nsw i32 %tmp26, %div28             ; <i32> [#uses=1]
  %tmp30 = load i32* %size.addr                   ; <i32> [#uses=1]
  %div31 = sdiv i32 %tmp30, 2                     ; <i32> [#uses=1]
  call void @fractal(i32 %sub25, i32 %add29, i32 %div31)
  %tmp32 = load i32* %x.addr                      ; <i32> [#uses=1]
  %tmp33 = load i32* %size.addr                   ; <i32> [#uses=1]
  %div34 = sdiv i32 %tmp33, 2                     ; <i32> [#uses=1]
  %add35 = add nsw i32 %tmp32, %div34             ; <i32> [#uses=1]
  %tmp36 = load i32* %y.addr                      ; <i32> [#uses=1]
  %tmp37 = load i32* %size.addr                   ; <i32> [#uses=1]
  %div38 = sdiv i32 %tmp37, 2                     ; <i32> [#uses=1]
  %sub39 = sub i32 %tmp36, %div38                 ; <i32> [#uses=1]
  %tmp40 = load i32* %size.addr                   ; <i32> [#uses=1]
  %div41 = sdiv i32 %tmp40, 2                     ; <i32> [#uses=1]
  call void @fractal(i32 %add35, i32 %sub39, i32 %div41)
  br label %return

return:                                           ; preds = %if.end, %if.then
  ret void
}

declare i32 @cl_set_color(...)

declare i32 @cl_draw_point(...)

define void @kernel_main() nounwind {
entry:
  call void @fractal(i32 256, i32 256, i32 256)
  ret void
}


